﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter11.Code03.Code01
{
    public class Demo
    {
        public static void Begin()
        {
            {
                ConvClass1 op1 = new ConvClass1();
                op1.Val = 3;
                ConvClass2 op2 = op1;
            }
            {
                ConvClass2 op1 = new ConvClass2();
                op1.Val = 3e15;
                try
                {
                    ConvClass1 op2 = (ConvClass1)op1;
                }
                catch (OverflowException e)
                {
                    Console.WriteLine(e.Message);
                    return;
                }
            }
        }
    }
}
